package com.laiketui.app.controller;

import com.laiketui.app.api.services.FootprintService;
import com.laiketui.domain.vo.MainVo;
import com.laiketui.core.domain.Result;
import com.laiketui.core.exception.LaiKeAPIException;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Map;

/**
 * 我的历史记录
 * 遗弃
 * @author Trick
 * @date 2020/10/30 15:48
 */
public class FootprintController {

    private FootprintService footprintService;

    @PostMapping("footprintIndex")
    public Result index(MainVo vo) throws LaiKeAPIException{
        try {
            Map<String, Object> resultJson = footprintService.index(vo);
            return Result.success(resultJson);
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }

    @PostMapping("alldelIndex")
    public Result alldel(MainVo vo,int footprintId) throws LaiKeAPIException{
        try {
            boolean resultJson = footprintService.alldel(vo,footprintId);
            return Result.success(resultJson);
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }
}
